﻿using MediatR;
using T_Material.Domain;
using T_Material.Infrastructure.Interface;
using T_Material.Read.API.Application.Commands.WarehousingCommand;

namespace T_Material.Read.API.Application.CommandHandlers.WarehousingHandler
{
    public class WarehousingInfoCommandHandler : IRequestHandler<WarehousingInfoCommand, Warehousing>
    {
        private readonly IWarehousingRepository warehousingRepository;
        public WarehousingInfoCommandHandler(IWarehousingRepository warehousingRepository)
        {
            this.warehousingRepository = warehousingRepository;
        }

        public Task<Warehousing> Handle(WarehousingInfoCommand request, CancellationToken cancellationToken)
        {
            var info = warehousingRepository.Get(request.Id);
            return info;
        }
    }
}
